IRange
Ecng.ComponentModel
Generic range contract exposing strongly-typed bounds.
Implementa: IRange, ICloneable
Propriedades
Length
public T Length { get; }
value = iRange.Length
Gets the difference between the maximum and minimum values of the range.
Métodos
Contains
public bool Contains(T value)
result = iRange.Contains(value)
Determines whether the specified value is within the current range.
- value
- The value to test.
Retorna: true if the value is within the range; otherwise, false.
Contains
public bool Contains(IRange<T> range)
result = iRange.Contains(range)
Determines whether the current range completely contains another range.
- range
- The range to check against.
Retorna: true if the range is contained; otherwise, false.
Intersect
public IRange<T> Intersect(IRange<T> range)
result = iRange.Intersect(range)
Returns the intersection of the current range with another range.
- range
- The range with which to intersect.
Retorna: A new IRange representing the overlap between the two ranges, or null if there is no intersection.
SubRange
public IRange<T> SubRange(T min, T max)
result = iRange.SubRange(min, max)
Creates a sub-range from the current range given the specified minimum and maximum values.
- min
- The minimum value of the sub-range.
- max
- The maximum value of the sub-range.
Retorna: A new range representing the sub-range.